<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>上中下布局</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: Arial, sans-serif;
        }

        .container {
            width: 80%;
            margin: 0 auto;
        }

        .top,
        .bottom {
            background-color: #f0f0f0;
            padding: 20px;
            text-align: center;
        }

        .middle {
            background-color: #e0e0e0;
            padding: 20px;
            text-align: center;
            min-height: 300px;
            /* 为了让中间部分有高度，以便观察 */
        }

        .bottom {
            position: fixed;
            bottom: 0;
            width: 100%;
        }
    </style>
</head>

<body>
    <div class="container">
        <div class="top">
            <h2>顶部内容</h2>
        </div>
        <div class="middle">
            <h2>中间内容</h2>
        </div>
    </div>
    <div class="bottom">
        <div class="container">
            <div class="bottom">
                <h2>底部内容</h2>
            </div>
        </div>
    </div>
</body>

</html>